home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / ip / ka9q / net_src.arc / ax_mbx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-05-08  |  3.0 KB  |  94 lines

  1. /* see comment at the head of ax_mbx.c - Bdale */
  2. #ifdef XOBBS
  3. /* Defines for the ax.25 mailbox facility */
  4.  
  5. #define true      1
  6. #define false     0
  7.  
  8. /*defines that control forwarder states */
  9.  
  10. #define NOFWD     0
  11. #define SPAWNBBS  1
  12. #define DOCONNECT 2
  13. #define READXMIT  3
  14. #define GETCON    4
  15. #define CLEARCON  5
  16. #define WAITING   6
  17. #define NOCON     0    
  18. #define YESCON    1
  19. #define WAIT      2
  20.  
  21. struct message{
  22.     long mtype;
  23.     char mtext[1024];
  24. };
  25.  
  26. /* defines for protocol type in mailbox session structure*/
  27. #define AX25      1
  28. #define NTRM      2
  29.  
  30. struct mboxsess{        /*mailbox session structure*/
  31.     int proto;        /*is this a net/rom or ax25 session?*/
  32.     int pid;        /*id of bbs process*/
  33.         int bytes;        /*number of bytes for bbs to send at one time*/
  34.     int gotbytes;        /*number of bytes we have in buffer*/
  35.     union cbaddr {
  36.         struct ax25_cb *axbbscb; /*axp associated with this structure*/
  37.         struct nr4cb *axnrcb;   /* cb associated with the structure*/
  38.     } cbadr;
  39.     struct message rmsgbuf;  /*receive message buffer for this structure*/
  40.     char call[7];        /*call of user*/
  41.     char *mtxtptr;        /*buffer pointer for this structure*/
  42.     struct mboxsess *next;    /*pointer to next session*/
  43. };
  44.  
  45. #define NULLMBS  (struct mboxsess *)0
  46. #define NULLFWD  (struct ax25_cb *)0
  47.  
  48. extern int ax25mbox ;
  49.  
  50. #else /* not XOBBS */
  51.  
  52. /* Defines for the ax.25 mailbox facility */
  53.  
  54. #define NUMMBX        10        /* max number of mailbox sessions */
  55.  
  56. #define MBXLINE        128        /* max length of line */
  57. struct mbx {
  58.     int state ;                /* mailbox state */
  59. #define MBX_CMD        1        /* in command mode */
  60. #define MBX_SUBJ    2        /* waiting for a subject line */
  61. #define MBX_DATA    3        /* collecting the message */
  62.     int type ;                /* type of connection */
  63. #define MBX_AX25    1        /* ax25 connection */
  64. #define MBX_NETROM    2        /* net/rom transport connection */
  65.     char name[10] ;            /* Name of remote station */
  66.     union {
  67.         struct ax25_cb    *ax25_cb ;    /* ax.25 link control block */
  68.         struct nr4cb *nr4_cb ;        /* net/rom link control block */
  69.     } cb ;
  70.     char *to ;                /* To-address in form user or user@host */
  71.     char *tofrom ;            /* Optional <from in to-address */
  72.     char *tomsgid ;            /* Optional $msgid in to-address */
  73.     FILE *tfile ;            /* Temporary file for message */
  74.     char line[MBXLINE+1] ;    /* Room for null at end */
  75.     char *lp ;                /* line pointer */
  76.     int mbnum ;                /* which mailbox session is this? */
  77.     int sid ;                /* Characteristics indicated by the SID */
  78.                             /* banner of the attaching station.  If */
  79.                             /* no SID was sent, this is zero.  If an */
  80.                             /* SID of any kind was received, it is */
  81.                             /* assumed that the station supports */
  82.                             /* abbreviated mail forwarding mode. */
  83. #define    MBX_SID        0x01    /* Got any SID */
  84. #define    MBX_SID_RLI    0x02    /* This is an RLI BBS, disconnect after F> */
  85.                             /* Space here for others, currently not of */
  86.                             /* interest to us. */
  87.     char stype ;            /* BBS send command type (B,P,T, etc.) */
  88. } ;
  89. #define     NULLMBX        (struct mbx *)0
  90.  
  91. extern struct mbx *mbox[NUMMBX] ;
  92. extern int ax25mbox ;
  93. #endif /* XOBBS */
  94.